<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            display: flex;
        }
         div{
                       width: 500px;
         }
        div img{
            width: 100%;
        }
    </style>
</head>

<body>
<div>
    <img src="img/stainless-steel-fork-near-clear-glass-on-tray-1510690.jpg">
</div>
   <script>
       var a={
           b:'1'
       }
       function am(ar) {
             ar.b=2;
       }
       am(a);
      console.log(a);
       </script>
</body>
</html>